Skip to content

HVAA优化及BUG修复 - #155

Open
WayneFerdon wants to merge 577 commits into
dodying:masterfrom
WayneFerdon:master
Open

HVAA优化及BUG修复#155
WayneFerdon wants to merge 577 commits into
dodying:masterfrom
WayneFerdon:master

Conversation

@WayneFerdon

@WayneFerdon WayneFerdon commented Aug 21, 2025

Copy link
Copy Markdown
Contributor
  1. 增加初始闲置竞技场配置非空检测
  2. 修正其他技能的OC判断及选择范围判断,修正条件判断中iscd的值与Readme中示例不相符的问题 (修复技能可释放判断及其他技能技能排序无效问题 #154 未进行冲突处理直接覆盖了,因此按照其中实际有效的内容重新修改了)

@Qiyue0515

Copy link
Copy Markdown

最近转法发现一个问题:
// 先处理特殊的 “先给全体上buff”
let skillPack = ['We', 'Im'];
这里改成先上weaken再上Imperil会比较好,这样血线的压力会小一点

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

最近转法发现一个问题: // 先处理特殊的 “先给全体上buff” let skillPack = ['We', 'Im']; 这里改成先上weaken再上Imperil会比较好,这样血线的压力会小一点

@Qiyue0515 现在这个应该就是先we再im的啊

@DreamSeeker08

Copy link
Copy Markdown

最近转法发现一个问题: // 先处理特殊的 “先给全体上buff” let skillPack = ['We', 'Im']; 这里改成先上weaken再上Imperil会比较好,这样血线的压力会小一点

你好,能分享一个法系的设置给我导入吗?
我不太会弄,更新到最新的v2.90.22.20还是不会释放陷危、虚弱等debuf

@Kotone-Hikaru

Copy link
Copy Markdown

法师好像不能正确的释放im 只会释放weaken 在给每个怪都上完weaken之后就卡在这里了

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@DreamSeeker08 @Sakuyasaki 之前的debuff逻辑有条件判断时可能会有点问题,分支新上传了一版(2.90.22.22),可以测试看下还有没有问题

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 2.90.22.22 imp正确释放了 但是全部上好imp之后不会自动释放攻击,但是鼠标移动到对应的怪上后才会攻击 且有的时候只会用普通攻击 不会释放t123法术

@WayneFerdon

WayneFerdon commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

@WayneFerdon 2.90.22.22 imp正确释放了 但是全部上好imp之后不会自动释放攻击,但是鼠标移动到对应的怪上后才会攻击 且有的时候只会用普通攻击 不会释放t123法术

@Sakuyasaki
我这里测试是正常的,普通和高级的都能够释放,不确定是什么原因
不过推测可能是战斗中途启用新脚本,导致ability数据未初始化,战斗中读取技能范围数据出错,这个节点刚好是点击完技能还没选目标(在算范围),如果有mb等脚本的话刚好移上去就选中了?
新的版本(2.90.22.23)增加了非空检测,可以再看下

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 确实是因为中途才开启脚本导致的 如果在一开始就开启然后再进入战斗的话就能正常释放t123
不过这个 自动闲置竞技场好像有点问题 还是说逻辑改变了

@Kotone-Hikaru

Copy link
Copy Markdown

AR好像是ok 的但是GF不行 不知道为什么

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

AR好像是ok 的但是GF不行 不知道为什么

@Sakuyasaki 有bug,修复了(2.90.22.24)

@Kotone-Hikaru

Kotone-Hikaru commented Oct 23, 2025

Copy link
Copy Markdown

发现现在的全部上debuff好像逻辑和之前的相比 不一样 之前会优先释放258这3个位子然后再释放没有释放到的
现在是按照优先级来释放的 大部分时候是乱序 会导致有的时候会多1t 理论上来说假如敌人是8个的话 第一次释放 2 5 7 这样应该是最好的 (有机会补到6号位没有上到debuff的情况)其他的按照258释放 一遍然后补漏掉的 比较好

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@Sakuyasaki
给全体放debuff的两个各加了选项,可以选是按照位置还是权重释放
按位置还是用权重的逻辑,但是统一权重为-1而非按状态计算,保留结合用死亡、已有debuff等的特殊权重进行排除
本来想直接改了,但是We给高权重的先放有时也能降低自己受到的伤害,所以各自处理了(

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 感谢 现在自动gf 已经正常工作了 但是debuff顺序释放好像还是没生效 现在还是按照权重来释放的

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@WayneFerdon 感谢 现在自动gf 已经正常工作了 但是debuff顺序释放好像还是没生效 现在还是按照权重来释放的

@Sakuyasaki 应该修复了(2.90.22.26)
漏了选初始目标也要按顺序了(

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 观察了一下 现在的释放 第一次 释放目标1 会给 123上(可能是机制?给第一位上会顺延到后面) 第二次就会释放4 但是这个时候只会给45上debuff 这样3的位置会被重复上debuff 浪费了一个轮次 感觉还是应该改为给2 5 8位置轮流释放

@Kotone-Hikaru

Copy link
Copy Markdown
function getRangeCenterID(target, range = undefined, isWeaponAttack = false, excludeCondition = undefined, forceUseIndex = undefined) {
    // 静态计数器
    if (typeof getRangeCenterID.callCount === 'undefined') getRangeCenterID.callCount = 0;
    getRangeCenterID.callCount++;

    // --- 固定顺序目标 ---
    const fixedIndices = [1, 4, 7]; // 数组索引
    let msTemp = JSON.parse(JSON.stringify(g('battle').monsterStatus));
    msTemp.sort(objArrSort('order'));

    if (getRangeCenterID.callCount <= fixedIndices.length) {
        // 尝试获取固定目标,如果越界或死亡就跳过
        for (let i = getRangeCenterID.callCount - 1; i < fixedIndices.length; i++) {
            const idx = fixedIndices[i];
            if (idx >= 0 && idx < msTemp.length && !msTemp[idx].isDead) {
                return getMonsterID(msTemp[idx].order);
            }
        }
        // 如果固定顺序没有可用目标,回归正常逻辑
    }

    // ---------------- 原本逻辑 ----------------
    if (!range) return getMonsterID(target);

    const centralExtraWeight = -1 * Math.log10(1 + (isWeaponAttack ? ((g('option').centralExtraRatio / 100) ?? 0) : 0));
    let order = target.order;
    let newOrder = order;

    let unreachableWeight = g('option').unreachableWeight;
    let minRank = Infinity;

    for (let i = order - range; i <= order + range; i++) {
        if (i < 0 || i >= msTemp.length || msTemp[i].isDead) continue;

        let rank = 0;
        for (let j = i - range; j <= i + range; j++) {
            let cew = (j === i) ? centralExtraWeight : 0;
            let mon = msTemp[j];

            if (j < 0 || j >= msTemp.length || mon.isDead || (excludeCondition && excludeCondition(mon))) {
                rank += unreachableWeight - cew;
                continue;
            }

            rank += cew;
            rank += forceUseIndex ? -1 : mon.finWeight;
        }

        if (rank < minRank) {
            minRank = rank;
            newOrder = i;
        }
    }

    return getMonsterID(newOrder);
}

让GPT写了一下 我试了一下这样是ok的 可以正确的释放到正确的258的位置()

@WayneFerdon

WayneFerdon commented Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

@WayneFerdon 观察了一下 现在的释放 第一次 释放目标1 会给 123上(可能是机制?给第一位上会顺延到后面) 第二次就会释放4 但是这个时候只会给45上debuff 这样3的位置会被重复上debuff 浪费了一个轮次 感觉还是应该改为给2 5 8位置轮流释放

@Sakuyasaki
gpt这个即使不是全体或按顺序也会强行按顺序,而且目标死亡往后跳一个实际也会将死亡的包含在范围内了,也是不对的

原来的是按照顺序从上往下选需要释放的
但是释放本身可能会失败(被抵抗了)
你的这个可能是放了123,然后选5放456,但是6被抵抗了
例如:

  1. 在2放完123
  2. 在5放456,5失败
  3. 此时因为5需要释放,而包含5的最优的范围为567,就会在6释放567

不过这个也有问题,新的版本已经改为:

  1. 释放全体时会遍历全部需要放的目标
  2. 然后选出包含任意目标中权重最优的(按顺序的话仍是单个权重为-1)
  3. 这样就能优先往后去释放一片目标(无论是按顺序还是实际权重,确保收益最大化)
  4. 然后再进行补漏(失败或者未释放到的)

@Kotone-Hikaru

Copy link
Copy Markdown

新版这个 选择权重好像还是有点问题 在8个怪的时候 有时候会先在2或者6释放,这样123 567都会上上debuff 然后就会空下来4和8 这样会多放一次imp 这里的逻辑感觉如果是要按照释放的debuff到底有没有赋予 然后再对应的改变逻辑好像有点复杂()

@Kotone-Hikaru

Copy link
Copy Markdown

想到一个逻辑大概是就是重下往上检测第一个带debuff的 然后+2就是下一个需要释放的目标
比如给123上好imp了 然后下一个就应该上在5
假如1和3抵抗了 就给2的+2上 那就是345 然后漏掉的之后再补?
不知道能不能实现()

@WayneFerdon

WayneFerdon commented Oct 25, 2025

Copy link
Copy Markdown
Contributor Author

@Sakuyasaki 遍历的时候忘记按照顺序遍历了,导致还是按照权重遍历,后面权重高,先遍历到被记录了,然后遍历到前面的低权重的时候,算出来有效范围都一样,不大于先记录的,所以没覆盖掉
2.90.22.29已改为要按顺序的话就会按顺序遍历,这下应该行了(

想到一个逻辑大概是就是重下往上检测第一个带debuff的 然后+2就是下一个需要释放的目标 比如给123上好imp了 然后下一个就应该上在5 假如1和3抵抗了 就给2的+2上 那就是345 然后漏掉的之后再补? 不知道能不能实现()

从下往上找这个如果之前手动选了最后一个,就会变成直接补漏,所以还是得上面这个修复(

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 试了一下好像好像正常工作了 感谢更新

@Kotone-Hikaru

Kotone-Hikaru commented Oct 27, 2025

Copy link
Copy Markdown

发现卷轴使用有点异常 守护卷轴好像 有点问题 同样的条件 一次 gf 其他卷轴都是15左右 守护卷轴用了150
image
且这个好像没有效果 在ar也会不停释放守护卷轴

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

发现卷轴使用有点异常 守护卷轴好像 有点问题 同样的条件 一次 gf 其他卷轴都是15左右 守护卷轴用了150 image 且这个好像没有效果 在ar也会不停释放守护卷轴

@Sakuyasaki 我这里是正常的啊(
没有一直放,而且筛选也是有用的
不过原来的释放逻辑也有点问题,也稍微改了下(2.90.22.30)

@Kotone-Hikaru

Copy link
Copy Markdown

@WayneFerdon 这个有没有什么办法能导出log之类的吗

@Kotone-Hikaru

Kotone-Hikaru commented Oct 27, 2025

Copy link
Copy Markdown
You evade the attack from Macallan. -- Aiga Mizuki crits you for 3810 wind damage. You evade the attack from Google Dancing Israelis. You evade the attack from Hemidactylus. You evade the attack from Storyteller. Youshi153 gains the effect Imperiled. Hemidactylus gains the effect Coalesced Mana. Hemidactylus gains the effect Imperiled. Practiced Ass Spanker gains the effect Imperiled. You cast Imperil.   Cooldown expired for Storms of Njord You are healed for 11583 Health Points. You cast Cure.   You gain the effect Protection. You use Scroll of Protection.   Cooldown expired for Cure You evade the attack from Youshi153. You evade the attack from Practiced Ass Spanker. Hemidactylus gains the effect Coalesced Mana. Hemidactylus gains the effect Imperiled. Practiced Ass Spanker gains the effect Imperiled. Macallan gains the effect Imperiled. You cast Imperil.   You evade the attack from Macallan. Aiga Mizuki crits you for 3487 wind damage. You evade the attack from Storyteller. Hemidactylus crits you for 5077 slashing damage. Your spirit shield absorbs 1553 points of damage from the attack into 24 points of spirit damage. Aiga Mizuki gains the effect Imperiled. Storyteller gains the effect Coalesced Mana. Storyteller gains the effect Imperiled. Google Dancing Israelis gains the effect Imperiled. You cast Imperil.   Google Dancing Israelis hits you for 2676 wind damage. You evade the attack from Youshi153. You are healed for 11583 Health Points. You cast Cure.   Spawned Monster G: MID=282436 (Youshi153) LV=500 HP=174260 Spawned Monster F: MID=110494 (Hemidactylus) LV=500 HP=203444 Spawned Monster E: MID=153284 (Practiced Ass Spanker) LV=500 HP=183060 Spawned Monster D: MID=124000 (Macallan) LV=500 HP=183060 Spawned Monster C: MID=112618 (Aiga Mizuki) LV=500 HP=179060 Spawned Monster B: MID=194240 (Storyteller) LV=500 HP=171860 image 这是一次异常的释放保护卷轴的战斗记录

我试了几次 每次在异常释放卷轴的时候 都会放一个cure

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@lukasva77

I've tried to revert sleep from 1000 after the battle finished but it was still stuck was always reverting to 1000 is this a bug??? I've restored the configuration from backup

Backups works for me, not sure what happened.

For easy configuration and other config issues, it's not that easy to match all those differences and keep the UI clean for the most. Many functions can now be configured by formulas, and this is the best way to include a variety of them as far as I know.
Perhaps try giving those config issues to the community or AI might help?

also in persistent I sometimes die to ponies they destroy my spirit how to only add a single debuff like weaken to only round 100 I can clear PFUDORFEST almost always but those ponies sure are strong but my equipment isn't maxed yet could be fixed over time as I get more stats like evade higher

Try roundNow and targetName ?

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@JKU533

2.91.126已经修复了

不好意思...漏看更新了 在想着现在的-1权重应该不需要分那么细才对,还是我伤害太高了?(印象中现在爬塔的攻击范围也没啥大问题)

可能分组调整存活数或分组总血量的权重比较简单? 3人一组,权重=分组存活数*-5 这样能确保3人一组存活数最多的为攻击目标吧? ((targetGroup_s_3 > 0) * 0 + _targetIsAlive_gsum) * -5

这个不太确定效果,不过加了新的参数和公式,可能比这个精准

步进时不时在这里会卡着不能进入下一轮(不是一定触发) image

步进按钮不能进入下一轮 手动点击继续下一轮是能进去的,所以应该不是网络问题?

我这里是能进去的,不太确定是什么情况。报错看着可能是脚本移除了页面变量导致的,不确定是不是hvAA引起的,或是其他兼容性问题导致的,因为我这边是能正常步进进下一轮的

@eric-lsd08

Copy link
Copy Markdown

2.91.128 新增了功能,可針對不同技能增加額外權重

例如在T2的法術中使用 ((skill.112===1)+(skill.122===1)+(skill.132===1)+(skill.142===1)+(skill.152===1)+(skill.162===1)) * ...

好快的更新,感謝大大!

我嘗試給第8號(Monster H)加權,但T2沒有指向對應範圍,不知道這樣設置是否正確?
1

@WayneFerdon

WayneFerdon commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@eric-lsd08
權重只會影響單個目標,選擇目標的結果會變成包含這個目標的範圍中圈子最優先的,可能targetOrder要取範圍而不是直接等於7,使得整個需要的範圍內的目標都附加這個權重

@WayneFerdon

WayneFerdon commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@eric-lsd08 或者用類似(targetOrder-7)^2<=5這種按距離賦權也行

@eric-lsd08

eric-lsd08 commented Aug 26, 2026

Copy link
Copy Markdown

@eric-lsd08 權重只會影響單個目標,選擇目標的結果會變成包含這個目標的範圍中圈子最優先的,可能targetOrder要取範圍而不是直接等於7,使得整個需要的範圍內的目標都附加這個權重
@eric-lsd08 或者用類似(targetOrder-7)^2<=5這種按距離賦權也行

我嘗試在weight += resolveRPNFormula(skillExtraWeight, target) 前後加console log測了下邏輯,沒理解錯的話,現在是在已選的權重目標按技能範圍內加權。比如權重目標先指向了1號,按T2技能範圍再計算權重,到最後也只會在範圍內的1-7號加權了,無法直接指向範圍外的8-10號。

按距離加權或許能指向技能範圍內最接近的目標來間接覆蓋到實際需要的範圍,但始終不是直接指向,感覺也更複雜了。。。

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

@eric-lsd08
2.91.132 加了個參數方法weighted,可用在target類參數前面,如weighted.targetOrder,在獲取對應的target參數前會先附加skillExtraWeight並重新排序。
這樣在判斷釋放條件的時候就可以先加上 技能的額外權重(並配置上 和範圍相關的內容),可能會更接近想要的效果?

PS:為了避免無窮遞歸,在計算skillExtraWeight的公式中使用weighted時,將總是直接返回不按weighted的結果,因為此時必然是已經重新排序的

但是還沒具體詳細測試效果,只是應該不會報錯之類的(

@WayneFerdon

WayneFerdon commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

另外還加了一些 skill.[] 的縮寫參數,例如skill.attackTier == 2可用於判斷是否處於T2法術判定中,而不需要一堆id的結果加起來(
雖然其中有些應該也用不到

@lukasva77

Copy link
Copy Markdown

@lukasva77

I've tried to revert sleep from 1000 after the battle finished but it was still stuck was always reverting to 1000 is this a bug??? I've restored the configuration from backup

Backups works for me, not sure what happened.

For easy configuration and other config issues, it's not that easy to match all those differences and keep the UI clean for the most. Many functions can now be configured by formulas, and this is the best way to include a variety of them as far as I know. Perhaps try giving those config issues to the community or AI might help?

also in persistent I sometimes die to ponies they destroy my spirit how to only add a single debuff like weaken to only round 100 I can clear PFUDORFEST almost always but those ponies sure are strong but my equipment isn't maxed yet could be fixed over time as I get more stats like evade higher

Try roundNow and targetName ?

I meant I put sleep to value 1000 and couldn't revert it I tried backspace changing it by typing nothing worked this was in battle so I was thinking it doesn't work inside the battle so I tried all of that after the battle ended and it was still stuck so I used tools restore which worked no problem I meant the first part being a bug as the value was stuck

About the ponies I meant that I am too stupid to configure this script to details like that I make heavy use of debuff all cause it is one click but I've saved over time multiple configs that people have posted here and haven't tried them yet I could copy some stuff from that

If you could add some stuff that works with one click mostly for high level tower it would be nice but also hight level tower has no point and I mean over floor 100 or for the ponies but that would require changing the UI but It's not a request cause the ponies I will outgrow with stronger equipment over time and tower is pointless

@lukasva77

Copy link
Copy Markdown

Can't start item world worked for me before even though figuring out the UI for it was hard

stamina
Object { current: 28, time: 1788018783314, punish: undefined, perk: undefined, lastRatio: 1, lastRatioRaw: undefined, ratio: 1, ratioRaw: "-1 / 0.2 = -5" }

27 -> 28 = 0.2 * 1 [HV]AutoAttack.user.js:5612:13

changeArenaEquipSet for arena [iw]: undefined =>
Object { }
[HV]AutoAttack.user.js:6117:13

stamina check succeed: true
low: 5 cost: 0.2 current: 28 ( + 23 )
stamina:
Object { current: 28, time: 1788018783314, lastRatio: 1, ratio: 1, ratioRaw: "-1 / 0.2 = -5" }
[HV]AutoAttack.user.js:5906:13

Arena Start e2761664 (0 => 1) / 25
{"name":" 📌🛡️ Legendary Mithril Tower Shield of the Barrier","id":"2761664","filter":"shield","level":0,"world":0,"max":25,"round":5} [HV]AutoAttack.user.js:6390:13

Arena Fetch Done. altBattleFirst: undefined Arena goto
Object { postoken: "hqjvpnmb6hmgrl22b4z", enabled: (14) […], date: 1788018663921, gr: 1, arrayDone: [], equip: {…} }
[HV]AutoAttack.user.js:6409:15

@WayneFerdon

Copy link
Copy Markdown
Contributor Author

Can't start item world worked for me before even though figuring out the UI for it was hard

stamina Object { current: 28, time: 1788018783314, punish: undefined, perk: undefined, lastRatio: 1, lastRatioRaw: undefined, ratio: 1, ratioRaw: "-1 / 0.2 = -5" }

27 -> 28 = 0.2 * 1 [HV]AutoAttack.user.js:5612:13

changeArenaEquipSet for arena [iw]: undefined => Object { } [HV]AutoAttack.user.js:6117:13

stamina check succeed: true low: 5 cost: 0.2 current: 28 ( + 23 ) stamina: Object { current: 28, time: 1788018783314, lastRatio: 1, ratio: 1, ratioRaw: "-1 / 0.2 = -5" } [HV]AutoAttack.user.js:5906:13

Arena Start e2761664 (0 => 1) / 25 {"name":" 📌🛡️ Legendary Mithril Tower Shield of the Barrier","id":"2761664","filter":"shield","level":0,"world":0,"max":25,"round":5} [HV]AutoAttack.user.js:6390:13

Arena Fetch Done. altBattleFirst: undefined Arena goto Object { postoken: "hqjvpnmb6hmgrl22b4z", enabled: (14) […], date: 1788018663921, gr: 1, arrayDone: [], equip: {…} } [HV]AutoAttack.user.js:6409:15

@lukasva77
It works for me. The log seems works just fine and the battle should be started successfully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.